import {defineConfig} from 'vite';
import vue from '@vitejs/plugin-vue'
import vueJsx from "@vitejs/plugin-vue-jsx";

import AutoImport from "unplugin-auto-import/vite";
import Components from "unplugin-vue-components/vite";
import VitePluginVueDevTools from "vite-plugin-vue-devtools";
import {AntDesignVueResolver, ElementPlusResolver} from "unplugin-vue-components/resolvers";
import {fileURLToPath, URL} from "node:url";
// https://vitejs.dev/config/
export default defineConfig({
    base:"",
    plugins: [
        vue({
            script: {
                defineModel: true,
                propsDestructure: true,
            },
        }),
        vueJsx(),
        AutoImport({
            imports: ["vue", "vue-router", "@vueuse/core"],
            dts: "auto-imports.d.ts",
            resolvers: [ElementPlusResolver(), AntDesignVueResolver()],
        }),
        Components({
            resolvers: [ElementPlusResolver(), AntDesignVueResolver({
                importStyle: false
            })],
        }),
        VitePluginVueDevTools(),
    ],
    resolve: {
        alias: {
            "@": fileURLToPath(new URL("./src", import.meta.url)),
        },
    },
    css:{
        preprocessorOptions: {
            less:{
                javascriptEnabled: true,
            }
        }
    }
})
